package com.lbb.xcx.auto;


import java.util.ArrayList;
import java.util.List;

public class Test {

    private List<Integer> list;

    public List<Integer> getList() { return list; }
    public void setList(List<Integer> list) { this.list = list; }

    public static void main(String[] args) {
        List<Integer> test = new ArrayList<>();
        test.add(1);
        test.add(2);

        Test t = new Test();
        t.setList(test);

        System.out.println("添加前:");
        System.out.println(t.getList());
        System.out.println("0:"+test.get(0));
        System.out.println("1:"+test.get(1));

        t.getList().add(3);
        System.out.println("添加后:");
        System.out.println(t.getList());
    }
}